package com.auth.Sercurity.controller;

import com.auth.Sercurity.demo1.UserTaskStrategyFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author hujian
 * @version 1.0
 * @description: 登录控制
 * @date 2022/2/15 16:05
 */
@RestController
public class LoginController {

    @Resource
    UserTaskStrategyFactory userTaskStrategy;

    @RequestMapping("/hello")
    public String hello(){
        return "index";
    }

    @GetMapping("/")
    public String pegeIndex(){
        return "pegeIndex";
    }

    @GetMapping("/demo1")
    public String demo1(String userName){

       return UserTaskStrategyFactory.getUserTaskStrategy(userName).userTaskPorcess(userName);
    }
}
